#include "InetAddress.h"
#include "ServiceHandler.h"
#include "SocketStream.h"
#include "Reactor.h"
#include "MyReactor.h"
#include "Connector.h"
#include "EchoServiceHandler.h"
#include "RecvServiceHandler.h"
#include "EventHandler.h"
#include <cstdio>
#include <string>

int main()
{
  RecvServiceHandler * svcHandler = new RecvServiceHandler(MyReactor::instance());
  InetAddress addr("localhost", "15000");
  Connector<RecvServiceHandler> conn(MyReactor::instance());
  conn.connect(svcHandler, addr, Connector<RecvServiceHandler>::SYNC);
  svcHandler->peer().send("010188-1234");
  
  for (;;)
  {
    MyReactor::instance()->handleEvents();
  }

}
